wayland: Plug leak
authorCarlos Garnacho <carlosg@gnome.org>
Tue, 7 Apr 2015 14:58:01 +0000 (16:58 +0200)
committerCarlos Garnacho <carlosg@gnome.org>
Sat, 18 Apr 2015 16:11:27 +0000 (18:11 +0200)
We leak refs on the dest window if it gets set multiple times, expected to
happen as the DnD operation moves across the window.

gdk/wayland/gdkdnd-wayland.c

index f558bb52405eb6bc0ad1713a1c8f3ca3d3deb1bd..71e8e49764f0c4701ded42948b0964d40fa5677b 100644 (file)
@@ -418,6 +418,9 @@ _gdk_wayland_drag_context_set_dest_window (GdkDragContext *context,
                                            GdkWindow      *dest_window,
                                            uint32_t        serial)
 {
+  if (context->dest_window)
+    g_object_unref (context->dest_window);
+
   context->dest_window = dest_window ? g_object_ref (dest_window) : NULL;
   GDK_WAYLAND_DRAG_CONTEXT (context)->serial = serial;
   gdk_wayland_drop_context_update_targets (context);